//reports config start -->
var reportsDirectory = '/apps/auto_test/reports';
var detailReportDirectory =  reportsDirectory + '/detailReport';
//var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');  //local setting
var HtmlScreenshotReporter = require('/apps/auto_test/node_modules/protractor-jasmine2-screenshot-reporter');
var ScreenshotAndStackReporter = new HtmlScreenshotReporter({
    dest: detailReportDirectory,
    filename: 'EasyStockAutoTest.html',
    reportTitle: 'EasyStock Auto Test Report',
    showSummary: true,
    reportOnlyFailedSpecs: false,
    captureOnlyFailedSpecs: false,
    inlineImages: false //images in report, instead of links
});
// <-- reports config end

exports.config = {
    //seleniumAddress: 'http://localhost:4444/wd/hub',
    directConnect: true,
    specs: ['login-spec.js'],
    //chromeDriver: '76.0.3809.100',
    chromeDriver: '/apps/auto_test/driver/chromedriver_76.0.3809.100.exe',
    capabilities: {
        'browserName': 'chrome',
        getPageTimeout: 300000,
        allScriptsTimeout: 300000,
        jasmineNodeOpts: {defaultTimeoutInterval: 300000},
        //'acceptInsecureCerts': true,
        //'binary': 'F:/Program Files (x86)/Google/Chrome/Application/chrome.exe'
        chromeOptions: {
            binary: 'F:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
            //args: ['--headless','--disable-gpu']
            //args: ["--window-size=800,600"]
            //set full screen
            args: ["--start-maximized"]
        }
    },
    //protractor conf.js --suite login
    suites: {
        //home: ['homeSpec.js'],
        login: ['login-spec.js']
    },

    params: {
        baseurl: '',
        username: 'Thomas', // pass from command line as --params.username=...
        password: 'myPass' // pass from command line as --params.password =...
    },

    //reports setup start -->
    beforeLaunch: function () {
        return new Promise(function (resolve) {
            ScreenshotAndStackReporter.beforeLaunch(resolve);
        });
    },

    onPrepare: function () {
        jasmine.getEnv().addReporter(ScreenshotAndStackReporter);
    }

    // <-- reports setup end
};